<template lang="">
    <div>
       <h2>我是About的内容</h2> 
    </div>
</template>
<script>
export default {
    name:"About",
    mounted() {
        console.log('About组件重新挂载',this)
    },
    beforeDestroy() {
        console.log('About组件即将被销毁')
    },
    // 通过路由规则(router。而不是组件哦！！！！！)进入该组件时调用
    beforeRouteEnter (to, from, next) {
        // ...
        console.log("Abot--------beforeRouteEnter",to,from)
        if(to.meta.isAuth){
            if(localStorage.getItem('school')==='MEO'){
                next()
            }else{
                alert("无权限查看")
            }
        }else{
            console.log("=========")
            next()
        }
    },
    // 通过路由规则离开该组件时调用
    beforeRouteLeave (to, from, next) {
        // ...
        console.log("Abot--------beforeRouteLeave",to,from)
        next()
    }
}
</script>
<style lang="">
    
</style>